{extend name="layout" /}
{block name="css"}<link rel="stylesheet" href="/style/admin.css" media="all">{/block}
{block name="title"}课件列表{/block}
{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div style="padding-bottom: 10px;">
                <button class="layui-btn layuiadmin-btn-list" data-type="batchdel">删除</button>
                <button class="layui-btn layuiadmin-btn-list" data-type="add">添加</button>
            </div>
            <table id="LAY-app-course-document" lay-filter="LAY-app-course-document"></table>
            <script type="text/html" id="buttonTpl">
                {{#  if(d.status === 0){ }}
                <button class="layui-btn layui-btn-primary layui-btn-xs">审核中</button>
                {{#  } else if(d.status === 1){ }}
                <button class="layui-btn layui-btn-xs">上架</button>
                {{#  } else { }}
                <button class="layui-btn layui-btn-danger layui-btn-xs">下架</button>
                {{#  } }}
            </script>
            <script type="text/html" id="LAY-app-course-document-bar">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i
                        class="layui-icon layui-icon-edit"></i>编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
                        class="layui-icon layui-icon-delete"></i>删除</a>
            </script>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    layui.use(['index', 'course', 'table'], function () {
        var $ = layui.$
            , table = layui.table
            , form = layui.form;

        var active = {
            batchdel: function () {
                batchDel('course', 'LAY-app-course-document');
            },
            add: function () {
                add('添加课件', 'document', '700px', '400px', 'LAY-app-course-document');
            }
        };

        $('.layui-btn.layuiadmin-btn-list').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });
</script>
{/block}